import api from './config'
const axios = require('axios')
const request = axios.create({
  baseURL: api.baseURL,//树形下拉框接口地址
  // baseURL:api.expressURL,//拖拽表单接口地址
  // baseURL:api.chartUrl,//聊天室接口地址
  timeout: 1000
  // timeout: 50000
})
// request.interceptors.request.use(() => { })
export default (url, method, data, headers) => {
  return request({
    url,
    method,
    [method == 'get' ? 'params' : 'data']: data,
    headers
  })
}
